#include<fcntl.h>
#include<stdio.h>
#include<string.h>
#include<sys/select.h>
#define DATA_NUM (4)

int main(int argc,char *argv[])
{
    int fd,i;
	
	int WR,RD;
		
	char buf[4]={0};
	
	for(i = 1; i < 5 & i < argc; i++)
	{
	    sscanf(argv[i],"%d",&buf[i-1]);
	}
	
	fd = open("/dev/leds",O_RDWR);
	
	printf("%d\r\n",fd);
	
	if(-1 ==fd)
	{
		perror("open file error\r\n");
		return -1;
	}else
	{
		printf("open success\r\n");
	}
	
	WR = write(fd,buf,DATA_NUM);
	//RD = read(fd,buf,DATA_NUM);
	
	printf("WR:%d \r\n",WR);
	
	printf("user space \n");

	return 0;
}





